/**
 * +----------------------------------------------------------------------
 * | 「e家宜业」 —— 助力物业服务升级，用心服务万千业主
 * +----------------------------------------------------------------------
 * | Copyright (c) 2020-2022 https://www.chowa.cn All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed 未经许可不能去掉「e家宜业」和「卓瓦科技」相关版权
 * +----------------------------------------------------------------------
 * | Author: contact@chowa.cn
 * +----------------------------------------------------------------------
 */

function double(num) {
    if (num <= 9) {
        return `0${num}`;
    }

    return num;
}

export function yuan(num) {
    return parseFloat(Math.floor(Math.floor(num) / 100) + '.' + double(Math.floor(num) % 100));
}
